package io.renren.modules.web.controller;

import io.renren.common.utils.R;
import io.renren.modules.admin.service.BannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author jiajia
 * @Date 2019/12/18 16:43
 **/

@Api("轮播图")
@RestController(value = "webBannerController")
@RequestMapping("web/banner")
public class BannerController {

    @Autowired
    private BannerService bannerService;

    /**
     * 获取轮播图
     */
    @GetMapping("list")
    @ApiOperation("获取展示的轮播图")
    public R BannerList(){
        Map param=new HashMap();
        param.put("isShow",true);
        List banners = bannerService.getListByWrapper(param);
        return new R().put("banners",banners);
    }
}
